#! /bin/bash

set -eux
set -o pipefail

install_dir=$1
[ -d "${install_dir} "] && rm -rf ${install_dir}
mkdir -p ${install_dir}

echo $PWD
temp_cpus=${grep -w processor /proc/cpuinfo|wc -l}

# install python3.10.0
echo "install python3.10.0"
python_install_dir="$/usr"

tar zxvf Python-3.10.0.tgz
cd Python-3.10.0

./configure --prefix=${python_install_dir}
make -j ${tmp_cpus}
make install

## 要替换系统中的python软连接
